<template>
  <view class="yuongjin">
    <view class="module">
      <view class="ability1">
        <view class="item" @click="redirect('/pages_promotion/member/teamList?type=1')">
          <view class="text">我的直推</view>
          <view class="name">
          {{ data.zhitui ? data.zhitui : 0 }}
          <u-icon style="margin-left: 20px;" name="arrow-right" color="#303133" size="28"></u-icon>
          </view>
        </view>
        <view class="item" @click="redirect('/pages_promotion/member/teamList?type=2')">
          <view class="text">我的团队</view>

          <view class="name">
          {{ data.team ? data.team : 0 }}
          <u-icon style="margin-left: 20px;" name="arrow-right" color="#303133" size="28"></u-icon>
          </view>
        </view>
      </view>
    </view>

  </view>
</template>

<script>
export default {
  components: {
  },
  mixins: [],
  data() {
    return {
      data: {},
    }
  },
  onShow() {
    this.liandongteam()
    this.$api.sendRequest({
      url: "/api/member/judgeBuy",
      success: res => {
        console.log(res,'/api/member/judgeBuy');
        if(!res.data){
          uni.hideShareMenu()
        }
      }
    });
  },
  onLoad(data) {
    },
  methods: {
    liandongteam(){
      this.$api.sendRequest({
        url: '/api/member/liandongteam',
        success: res => {
          this.data = res.data
          console.log(this.data, 'this.data');
        }
      });
    },
    redirect(url){
      this.$util.redirectTo(url);
    },
  },
  onShareTimeline() {
    return {
      title: '鹏城快享',
      query: `source_member=${uni.getStorageSync("user_id")}`,
      imageUrl: ""
    }
  },
  onShareAppMessage() {
    return {
      title: "鹏城快享",
      path: `/pages/index/index?source_member=${uni.getStorageSync("user_id")}`,
      imageUrl: ''
    }
  },
};
</script>

<style lang="scss" scoped>
@import '@/common/css/diy.scss';


.yuongjin {
  margin: 20rpx 30rpx;
  padding-bottom: 30px;
}
.module {
  padding: 0px 10px 0px 10px;
  background: #fff;
  border-radius: 10px;
  margin-bottom: 10px;


  .ability {
    display: flex;
    justify-content: space-around;

    .item {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: space-between;
      padding-top: 10px;
      height: 60px;

      .img {
        width: 30px;
        height: 30px;
      }

      .text {
        color: #666;
      }
    }

  }

  .ability1 {
    .item {
      display: flex;
      justify-content: space-between;
      padding: 20px 0;
      border-bottom: 2px solid #f8f8f8;
      .text {
        color: #666;
      }
      .name {
        color: #303133;
      }
    }
  }

}


</style>

<style scoped >
.wap-floating>>>.uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
  background: none !important;
}

/deep/ .placeholder {
  height: 0;
}

/deep/::-webkit-scrollbar {
  width: 0;
  height: 0;
  background-color: transparent;
  display: none;
}

/deep/ .ns-copyright-info {
  margin-top: 40rpx;
  margin-bottom: 0;
}

.image-wrap {
  line-height: normal;
}

.image-wrap image {
  border-radius: 20rpx;
}
</style>